package per.zqx.rabbit.service.topic;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.stereotype.Service;

/**
 * FanoutEmailCustomer,
 *
 * @author Sa, Zhang 2021-06-06 15:22
 */
@Service
//@RabbitListener(queues = "email.topic.queue")
@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "email.topic.queue",durable = "true",autoDelete = "false"),
        exchange = @Exchange(value = "topic_order_exchange",type = ExchangeTypes.TOPIC),
        key = "#.email.#"
))
public class TopicEmailCustomer {
    @RabbitHandler
    public void receiveMassage(String message) {
        System.out.println("email topic received message -> " + message);
    }
}
